//package com.newtouch.avmarketing.mongo.controller;
//
//import com.newtouch.avmarketing.mgr.modules.avmarkrting.model.Result;
//import com.newtouch.avmarketing.mgr.modules.avmarkrting.model.ResultCodes;
//import com.newtouch.avmarketing.mongo.po.Comment;
//import com.newtouch.avmarketing.mongo.service.CommentService;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Page;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//@RestController
//@RequestMapping("/mongo")
//@Slf4j
//public class CommentController {
//    @Autowired
//    private CommentService commentService;
//
//    @PostMapping("/save")
//    public Result saveComment(@RequestBody Comment comment){
//        commentService.saveComment(comment);
//        return Result.of(ResultCodes.SUCCESS_CODE,"保存成功");
//    }
//
//    @PostMapping("/pageListComment")
//    public Result pageListComment(String parentid,int page,int size){
//        Page<Comment> byParentid = commentService.findByParentid(parentid, page, size);
//        return Result.of(ResultCodes.SUCCESS_CODE,"查询成功",byParentid);
//    }
//
//    //查询评论详情
//    @PostMapping("/findBynicknameAndId")
//    public Result findBynicknameAndId(String nickname){
//        List<Comment> list = commentService.findBynicknameAndId(nickname);
//        return Result.of(ResultCodes.SUCCESS_CODE,"查询成功",list);
//    }
//}
